var e = require;
var t = module;
var n = exports;
var o,
    i =
        (this && this.__extends) ||
        ((o = function (e, t) {
            return (o =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
                })(e, t);
        }),
        function (e, t) {
            function n() {
                this.constructor = e;
            }
            o(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n()));
        }),
    r =
        (this && this.__decorate) ||
        function (e, t, n, o) {
            var i,
                r = arguments.length,
                a = r < 3 ? t : null === o ? (o = Object.getOwnPropertyDescriptor(t, n)) : o;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(e, t, n, o);
            else
                for (var s = e.length - 1; 0 <= s; s--)
                    (i = e[s]) && (a = (r < 3 ? i(a) : 3 < r ? i(t, n, a) : i(t, n)) || a);
            return 3 < r && a && Object.defineProperty(t, n, a), a;
        };
Object.defineProperty(n, "__esModule", {value: !0});
var a,
    s = e("player-info"),
    c = e("game"),
    t = cc._decorator,
    e = t.ccclass,
    t = t.property,
    e =
        ((a = cc.Component),
        i(l, a),
        (l.prototype.start = function () {
            var n = this;
            this.coinAnim.on(cc.Animation.EventType.FINISHED, function (e, t) {
                "Bigcoin_Appear" == t.name && n.moveEnd && n.moveEnd();
            });
        }),
        (l.prototype.playApper = function (e) {
            var t = this;
            (this.moveEnd = e),
                this.coinAnim.play("Bigcoin_Appear"),
                this.coinParticleSystem &&
                    this.scheduleOnce(function () {
                        t.coinParticleSystem.resetSystem();
                    }, this.liziDelayTime);
        }),
        (l.prototype.init = function (e) {
            var t, n, o;
            this.label &&
                ((o =
                    (t = s.playerInfo.getLevel()) -
                    (n = Math.floor((t - 1) / this.labelSpriteFrames.length)) * this.labelSpriteFrames.length -
                    1),
                (this.label.spriteFrame = this.labelSpriteFrames[o])),
                this.number &&
                    ((t = c.default.ins.getColors()),
                    (this.number.string = e.num.toString()),
                    (n = Math.floor((e.num - 1) / t.length)),
                    (o = e.num - n * t.length),
                    this.setIconFrame(this.labelSpriteFrames[o - 1]),
                    (this.number.node.color = t[o - 1]));
        }),
        (l.prototype.setIconFrame = function (e) {
            this.icon && (this.icon.spriteFrame = e);
        }),
        r([t(cc.Sprite)], l.prototype, "icon", void 0),
        r([t(cc.Sprite)], l.prototype, "label", void 0),
        r([t(cc.Label)], l.prototype, "number", void 0),
        r([t([cc.SpriteFrame])], l.prototype, "labelSpriteFrames", void 0),
        r([t(cc.Animation)], l.prototype, "coinAnim", void 0),
        r([t(cc.ParticleSystem)], l.prototype, "coinParticleSystem", void 0),
        r([t({displayName: "粒子播放延时"})], l.prototype, "liziDelayTime", void 0),
        r([e], l));
function l() {
    var e = (null !== a && a.apply(this, arguments)) || this;
    return (
        (e.icon = null),
        (e.label = null),
        (e.number = null),
        (e.labelSpriteFrames = []),
        (e.coinAnim = null),
        (e.coinParticleSystem = null),
        (e.liziDelayTime = 0.1),
        (e.moveEnd = null),
        e
    );
}
n.default = e;
